package com.cc.service.impl;

import com.cc.mapper.OrderMapper;
import com.cc.model.EbOrder;
import com.cc.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<EbOrder> list (int page, int pageSize) {
        return orderMapper.listByPage2((page-1)*pageSize,pageSize);
    }

    @Override
    public int save(EbOrder ebOrder){
        return orderMapper.save(ebOrder);
    }

    @Override
    public int deleteByPk(int eoId){
        return orderMapper.delete(eoId);
    }

    @Override
    public EbOrder selectByCondition(Integer eoId){
        return orderMapper.findById3(eoId);
    }

    @Override
    public int updateById(EbOrder ebOrder){
        return orderMapper.updateByPrimaryKey3(ebOrder);
    }

    @Override
    public int getMaxPage(int pageSize) {
        return orderMapper.getMaxPage(pageSize);
    }

}
